package weavingdraft;
import java.awt.Color;

import javax.swing.JPanel;

/**
 * 
 * @author Justin Wong
 * Class that creates the pattern square for the pattern grid. 
 *
 */

@SuppressWarnings("serial")
public class PatternSquare extends JPanel{
	/**
	 * The row this square refers to. 
	 */
	private int my_row;
	/**
	 * Column this square refers to. 
	 */
	private int my_column;
	
	/**
	 * Creates the square to the pattern grid. 
	 * 
	 * @param row the row the object will refer to.
	 * @param column the column the object will refer to. 
	 */
	public PatternSquare(int row, int column){
		my_row = row;
		my_column = column;
	}
	/**
	 * Gets the object's row.
	 * @return this objects row. 
	 */
	public int getRow(){
		return my_row;
	}
	/**
	 * Gets the object's column.
	 * @return the column number for this object.
	 */
	public int getColumn(){
		return my_column;
	}
	/**
	 * Sets the background to white. 
	 */
	public void setWhite(){
		this.setBackground(Color.WHITE);
	}
	/**
	 * Sets the background to black. 
	 */
	public void setBlack(){
		this.setBackground(Color.BLACK);
	}
}
